<?php
(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
/*
	[天生创想] (C)2008-2011 515158 Inc.
	This is NOT a freeware, use is subject to license terms
    URL:http://www.515158.com/
*/

get_config_keytable("knowledge_read");
empty($do) && $do = 'list';
if ($do == 'edit') {
	$id = getGP('id','G','int');
	$knowledge = $db->fetch_one_array("SELECT * FROM ".DB_TABLEPRE."knowledge  WHERE id = '$id'");
	include_once('template/edit.php');

} elseif ($do == 'save') {
	
	$savetype = getGP('savetype','P');
	$id = getGP('id','P','int');
	$categoryid = getGP('officetypeid','P');
	$title = getGP('title','P');
	$content = getGP('content','P');
	$number = getGP('number','P');
	$type = getGP('type','P');
	$knowledge = array(
		'title' => $title,
		'content' => $content,
		'categoryid' => $categoryid,
		'type' => $type
	);
	update_db('knowledge',$knowledge, array('id' => $id));
	$content=$title.get_inc_log(1).$content.get_inc_log(1).$number.get_inc_log(1).$categoryid.get_inc_log(1).$type;
	$title='修改知识';
	get_oa_log_dbadd($id,$content,$title,17,$_USER->id);
	goto_page('admin.php?ac=index&fileurl=knowledge');
	

}

?>